#include "app.h"
#include "bsp/cpu_driver.h"
#include "os/os.h"
#include "version.h"

#ifdef CONFIG_CAN_IAP
#ifdef STM32F4
const uint8_t iap_board_name[] __attribute__((at(0x8008800))) = CONFIG_BOARD_NAME;
const uint8_t soft_version[] __attribute__((at(0x8008A00))) = CONFIG_VERSION;
const uint8_t iap_volume[] __attribute__((at(0x8008C00))) = "App";
#elif defined(STM32G4)
const uint8_t iap_board_name[] __attribute__((at(0x8003800))) = CONFIG_BOARD_NAME;
const uint8_t soft_version[] __attribute__((at(0x8003A00))) = CONFIG_VERSION;
const uint8_t iap_volume[] __attribute__((at(0x8003C00))) = "App";
#else
const uint8_t iap_board_name[] __attribute__((at(0x8002800))) = CONFIG_BOARD_NAME;
const uint8_t soft_version[] __attribute__((at(0x8002A00))) = CONFIG_VERSION;
const uint8_t iap_volume[] __attribute__((at(0x8002C00))) = "App";
#endif
#endif

int main(void) {
    bsp_init();
    app_start();
    os_task_run();
    return 0;
}